# for-in.py
'''
    for 别名 in 遍历对象:
        
'''
# 1、遍历一个列表
list = ['c++','c','java','python','c#']
for a in list:
    print(a)
for a in "abcdfrg":
    print(a)
# 2、break 跳出循环
for a in list:
    print(a)
    if a=='python': break
        
i=0
while True:
    i+=1
    print(i)
    if i==10: break
# 3、使用for in输出0-9
for a in range(11):
    print(a)
# 4、输出10-20
for a in range(10,21):
    print(a)
# 5、输出100-1 这里-1是步长
for a in range(100,0,-1):
    print(a)
# 6、输出1-100 3、6、9 ...
for a in range(3,100,3):
    print(a)
# 7、continue 跳过
for a in "range":
    if a=="g":continue 
    print(a)  
